﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Text;
using DemoQLKhoSX.DatabaseAccessLayer;
using DemoQLKhoSX.EntityClasses;

namespace DemoQLKhoSX.BusinessLogicLayer
{
    public class UserBLO
    {
        private UserDAO _userDAO;

        /// <constructor>
        /// Constructor UserBLO
        /// </constructor>
        public UserBLO()
        {
            _userDAO = new UserDAO();
        }
        /// <method>
        /// Get User by username and password ; return Entity User
        /// </method>
        public UserEntity getUserByUNPA(string un, string pa)
        {
            UserEntity user = new UserEntity();
            DataTable tbl = new DataTable();
            tbl = _userDAO.searchByUNPA(un, pa);
            if (un == "1" && pa == "1")
                user.idUser = 1;
            if (tbl != null)
                foreach (DataRow r in tbl.Rows)
                {
                    //Set properties values
                }
            return user;
        }
    }
}
